#include <stdio.h>
#include <REG952.h>
#include "main.h"
//#define _SIMULATE_

void initInput(void)
{
	ADMODB = 0x20;
	AD0INS = 0x01;
	SCC0 =1;
	AD0CON = 0x01;
	AD0CON |= 0x04;
}

unsigned short get_ad(void)
{
	unsigned short inputReg;
	inputReg = AD0DAT0L;
	inputReg <<= 2;
	inputReg |= (0x03&AD0DAT0R);
	return inputReg;

}
